package com.numberma.userservice.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient("permission-service")
public interface permissionServiceClient {
    // 绑定默认角色（普通用户
    @PostMapping("/permissions/bindDefaultRole")

    void bindDefaultRole(@RequestParam("userId") Long userId);

    // 查询用户角色码（返回role_code）
    @GetMapping("/permissions/getUserRoleCode/{UserId}")
     String getUserRole(@PathVariable("UserId") Long userId);

    @GetMapping("/permissions/getUserIdsByRoleCode")
  List<Long> getUserIdsByRoleCode(String roleCode);
    // 超管调用：升级用户为管理员
    @PostMapping("/permissions/upgradeToAdmin")
    void upgradeToAdmin(@RequestParam("UserId") Long userId);

    // 超管调用：降级用户为普通角色
    @GetMapping("/permissions/downgradeToUser")
    void downgradeToUser(@RequestParam("UserId") Long userId);




}
